package com.nuc.controller;

import com.nuc.mapper.NewsMapper;
import com.nuc.pojo.News;
import com.nuc.service.NewsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author Zhang Chao
 * @Date 2021/5/12 10:37
 * @Version 1.0
 */
@Api(value = "新闻controller",tags = {"新闻接口"})
@RestController
@RequestMapping("/news")
public class NewsController {

    @Autowired
    NewsService newsService;

    @ApiOperation("新闻")
    @GetMapping("/allNews")
    public List<News> getAllNews(){
        return newsService.getAllNews();
    }
}
